package activator;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

public class Activator implements BundleActivator {

	int number;
	static int staticNumber;

	static {
		System.out.println("static{} initialization block");
		staticNumber = 10;
	}
	
	{
		System.out.println("initialization block");
	}

	public Activator() {
		System.out.println("constructor Activator()");
		number = 5;
	}

	public void start(BundleContext context) throws Exception {
		System.out.println("start() method");
		System.out.println("number= " + number);
		System.out.println("staticNumber= " + staticNumber);

		// increment fields
		number++;
		staticNumber++;

		System.out.println("Incremented fields: " + number + ", "
				+ staticNumber);

	}

	public void stop(BundleContext context) throws Exception {
		System.out.println("stop() method");
		System.out.println("--------------");

	}
}
